﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DependencyInjection
{
    /// <summary>
    /// This attribute is meant to be applied to methods. The method the [Initializer] attribute is 
    /// applied to may not take any arguments. The idea here is that, any object generated through
    /// the ObjectGenerator may have to be initialized. Normally, this can be done through a constructor,
    /// however in some cases (not-so-uncommon) initializing an object requires access to its 
    /// dependencies, which normally will not be available at object creation time. One choice is to
    /// do only constructor-dependency-injection, but that method excludes the possibility of having mutual
    /// or circular dependencies (or any loops in the dependency graph) which is again, not-so-uncommon.
    /// 
    /// This is the (my) alternative solution. An object will be generated, its dependencies will be satisfied,
    /// and only then any and all methods marked as [Initializer] will be called. 
    /// 
    /// If you mark a method as [Initializer], and make it take arguments, it will compile, yet bomb at runtime
    /// with an InvalidOperationException. You have been warned.
    /// 
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class Initializer : Attribute
    {
    }
}
